import 'package:easy_refresh/easy_refresh.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:jinke/page/report/model/ReportEntity.dart';

import 'index.dart';
import 'widgets/item_report.dart';

class ReportPage extends StatelessWidget {
  ReportPage({Key? key}) : super(key: key);
  final controller = Get.put(ReportController());
  // 主视图
  Widget _buildView() {
    return Padding(padding: EdgeInsets.only(top: 15.r),child: ListView.builder(itemBuilder: (context,index){
      ReportEntity entity = controller.state.entityList[index];
      return ItemReport(entity);
    },itemCount: controller.state.entityList.length,),);
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<ReportController>(
      builder: (_) {
        return Scaffold(
          backgroundColor: const Color(0xfff9f9f9),
          body: _buildView(),
        );
      },
    );
  }
}
